<style>
  .short-width {
      width: 320px;
  }
</style>

<div class="panel panel-default panel-intro">
  <div class="panel-heading">
    <div class="panel-lead"><em>系统配置</em></div>
    <ul class="nav nav-tabs">
      <li class="active"><a href="#tab-user_mini_app" data-toggle="tab">用户端小程序配置</a></li>
      <li class=""><a href="#tab-delivery" data-toggle="tab">相关配置</a></li>
      <li class=""><a href="#tab-withdraw" data-toggle="tab">财务配置</a></li>
      <li class=""><a href="#tab-about" data-toggle="tab">关于我们</a></li>
      <li class=""><a href="#tab-cooperation" data-toggle="tab">合作加盟</a></li>
      <!--<li class=""><a href="#tab-rider_enter" data-toggle="tab">骑手入驻协议</a></li>-->
    </ul>
  </div>

  <div class="panel-body">
    <div class="tab-content">
      <!--用户端小程序配置-->
      <div class="tab-pane fade active in" id="tab-user_mini_app">
        <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
          <!--<div class="bs-callout bs-callout-info" id="callout-helper-context-color-specificity">
            <h4>微信小程序配置</h4>
            <p>微信小程序、微信支付相关配置</p>
          </div>-->

          <div class="row">
            <div class="col-sm-1"></div>
            <div class="col-xs-12 col-sm-10">
              <div class="panel panel-default">
                <div class="panel-heading">微信小程序参数配置</div>
                <div class="panel-body">

                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Wx_mini_app_id')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <input id="c-wx_mini_app_id" data-rule="required" class="form-control" name="row[wx_mini_app_id]" type="text" value="{$row.wx_mini_app_id|default=''}">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Wx_mini_app_secret')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <input id="c-wx_mini_app_secret" class="form-control" name="row[wx_mini_app_secret]" type="text" value="{$row.wx_mini_app_secret|default=''}">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Wx_pay_mch_id')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <input id="c-wx_pay_mch_id" data-source="wx/pay/mch/index" class="form-control" name="row[wx_pay_mch_id]" type="text" value="{$row.wx_pay_mch_id|default=''}">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Wx_pay_v2_key')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <input id="c-wx_pay_v2_key" class="form-control" name="row[wx_pay_v2_key]" type="text" value="{$row.wx_pay_v2_key|default=''}">
                      <p class="help-block">*小程序提审时，开启此配置，隐藏部分隐私配置，避免审核不过</p>
                    </div>
                  </div>

                  <!--<div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('open_audit')}:</label>
                    <div class="col-xs-12 col-sm-8">

                        <div class="radio">
                            <label for="row[open_audit]-1"><input id="row[open_audit]-1" name="row[open_audit]" type="radio" value="1" {in name="$row.open_audit" value="1"}checked{/in} /> 开启</label>
                            <label for="row[open_audit]-0"><input id="row[open_audit]-0" name="row[open_audit]" type="radio" value="0" {in name="$row.open_audit" value="0"}checked{/in} /> 关闭</label>
                        </div>

                        <p class="help-block">*小程序提审时，开启此配置，隐藏部分隐私配置，避免审核不过</p>
                    </div>
                  </div>

                  <div class="form-group" data-favisible="open_audit=1">
                    <label class="control-label col-xs-12 col-sm-2">{:__('audit_version')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <input id="c-audit_version" class="form-control" name="row[audit_version]" type="text" value="{$row.audit_version|default='1.0.0'}">
                      <p class="help-block">*小程序提审时，设置的审核版本号与当前提审的一致时，会隐藏部分隐私配置，其他正在运行的版本不受影响。</p>
                      <p class="help-block">用户端小程序版本号在用户端uniapp目录user/api/config.js的version字段获取</p>
                    </div>
                  </div>-->

                </div>
              </div>
            </div>
          </div>

          <div class="row">
            <div class="col-sm-1"></div>
            <div class="col-xs-12 col-sm-10">
              <div class="panel panel-default">
                <div class="panel-heading">小程序分享配置</div>
                <div class="panel-body">

                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Share_title')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <input id="c-share_title" class="form-control" name="row[share_title]" type="text" value="{$row.share_title|default=''}">
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('Share_image')}:</label>
                    <div class="col-xs-12 col-sm-8">
                      <div class="input-group">
                        <input id="c-share_image" class="form-control" size="50" name="row[share_image]" type="text" value="{$row.share_image|default=''}">
                        <div class="input-group-addon no-border no-padding">
                          <span><button type="button" id="faupload-share_image" class="btn btn-danger faupload" data-input-id="c-share_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-share_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                          <span><button type="button" id="fachoose-share_image" class="btn btn-primary fachoose" data-input-id="c-share_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-share_image"></span>
                      </div>
                      <ul class="row list-inline faupload-preview" id="p-share_image"></ul>
                    </div>
                  </div>

                </div>
              </div>
            </div>
          </div>

          <div class="row">
            <div class="col-sm-1"></div>
            <div class="col-xs-12 col-sm-10">
              <div class="panel panel-default">
                <div class="panel-heading">小程序样式配置</div>
                <div class="panel-body">

                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">{:__('index_top_style')}:</label>
                    <div class="col-xs-12 col-sm-8">

                      <div class="radio">
                        <label for="row[index_top_style]-banner"><input id="row[index_top_style]-banner" name="row[index_top_style]" type="radio" value="banner" {in name="$row.index_top_style" value="banner"}checked{/in} /> 轮播图</label>
                        <label for="row[index_top_style]-map"><input id="row[index_top_style]-map" name="row[index_top_style]" type="radio" value="map" {in name="$row.index_top_style" value="map"}checked{/in} /> 地图</label>
                      </div>

                      <p class="help-block">*注意：地图模式必须配置腾讯地图key</p>
                    </div>
                  </div>

                  {include file="../application/admin/view/tongcheng/system_config/mini_app_theme_config.html" /}

                </div>
              </div>
            </div>
          </div>

          {include file="../application/admin/view/tongcheng/system_config/contact_config.html" /}

          <div class="row">
            <div class="col-sm-1"></div>
            <div class="col-xs-12 col-sm-10">
              <div class="panel panel-default">
                <div class="panel-heading">区域选择配置</div>
                <div class="panel-body">

                  <div class="form-group">
                    <label class="control-label col-xs-12 col-sm-2">自动选择区域:</label>
                    <div class="col-xs-12 col-sm-8">

                      <div class="radio">
                        <label for="row[zone_select_mode]-use_default"><input id="row[zone_select_mode]-use_default" name="row[zone_select_mode]" type="radio" value="use_default" {in name="$row.zone_select_mode" value="use_default"}checked{/in} /> 选择默认区域</label>
                        <label for="row[zone_select_mode]-use_near"><input id="row[zone_select_mode]-use_near" name="row[zone_select_mode]" type="radio" value="use_near" {in name="$row.zone_select_mode" value="use_near"}checked{/in} /> 选择距离最近区域</label>
                      </div>

                      <p class="help-block">*注意：选择距离最近区域模式，需要对【区域管理】中的区域设置坐标（安装<a href="https://www.fastadmin.net/store/address.html" target="_blank">地图位置选择插件</a>后方可设置坐标）</p>
                    </div>
                  </div>

                </div>
              </div>
            </div>
          </div>

          <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
              <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
              <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            </div>
          </div>
        </form>
      </div>

      <!--配送相关配置-->
      <div class="tab-pane fade" id="tab-delivery">
        <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('tx_map_key')}:</label>
            <div class="col-xs-6 col-sm-6">
              <input id="c-tx_map_key" class="form-control short-width" name="row[tx_map_key]" type="text" value="{$row.tx_map_key|default=''}">
              <p class="help-block">地图Key用于计算用户地点与目标地点距离使用，若未配置将无法计算距离及费用，<a
                href="https://lbs.qq.com/">点击前往申请</a>，在【控制台】-【我的应用】-【添加key】，添加【WebServiceAPI】类型的key并填写到此处</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('auto_cancel_unpaid')}:</label>
            <div class="col-xs-6 col-sm-6">
              <div class="input-group short-width">
                <input id="c-auto_cancel_unpaid" class="form-control" name="row[auto_cancel_unpaid]" type="number" value="{$row.auto_cancel_unpaid|default='15'}">
                <div class="input-group-addon">分钟</div>
              </div>
              <p class="help-block">用户下配送单后，超过分钟数后未支付，将自动取消订单</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('auto_cancel_unreceived')}:</label>
            <div class="col-xs-6 col-sm-6">
              <div class="input-group short-width">
                <input id="c-auto_cancel_unreceived" class="form-control" name="row[auto_cancel_unreceived]" type="number" value="{$row.auto_cancel_unreceived|default='15'}">
                <div class="input-group-addon">分钟</div>
              </div>
              <p class="help-block">用户下配送单并支付后，超过分钟数后无骑手接单，将自动取消订单并退款</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('auto_cancel_transfer')}:</label>
            <div class="col-xs-6 col-sm-6">
              <div class="input-group short-width">
                <input id="c-auto_cancel_transfer" class="form-control" name="row[auto_cancel_transfer]" type="number" value="{$row.auto_cancel_transfer|default='15'}">
                <div class="input-group-addon">分钟</div>
              </div>
              <p class="help-block">骑手发起配送单转单后，超过分钟数后目标骑手未同意接单，将自动取消本次转单</p>
            </div>
          </div>
          <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
              <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
              <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            </div>
          </div>
        </form>
      </div>

      <!--骑手财务配置-->
      <div class="tab-pane fade" id="tab-withdraw">
        <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('rider_min_withdraw_money')}:</label>
            <div class="col-xs-6 col-sm-6">
              <div class="input-group short-width">
                <input id="c-rider_min_withdraw_money" class="form-control" name="row[rider_min_withdraw_money]" type="number" step="0.01" min="0.01" value="{$row.rider_min_withdraw_money|default='0.01'}" placeholder="">
                <div class="input-group-addon">元</div>
              </div>
              <p class="help-block">限制骑手最低提现金额，最低不能小于0.01元</p>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('rider_withdraw_rate')}:</label>
            <div class="col-xs-6 col-sm-6">
              <div class="input-group short-width">
                <input id="c-rider_withdraw_rate" class="form-control" name="row[rider_withdraw_rate]" type="number" step="1" min="0" max="20" value="{$row.rider_withdraw_rate|default='0'}" placeholder="">
                <div class="input-group-addon">%</div>
              </div>
              <p class="help-block">骑手提现时，扣除提现金额的手续费率，最高不能超过20%</p>
            </div>
          </div>

          <!--<div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('rider_first_take_deduct_fee')}:</label>
            <div class="col-xs-6 col-sm-6">
              <div class="input-group short-width">
                <input id="c-rider_take_deduct_fee" class="form-control" name="row[rider_take_deduct_fee]" type="number" step="1" min="0" max="20" value="{$row.rider_take_deduct_fee|default='0'}" placeholder="">
                <div class="input-group-addon">%</div>
              </div>
              <p class="help-block">骑手每日首次接单时扣除费用（须在骑手管理页面设置骑手开启每日接单扣费开关才能生效）</p>
            </div>
          </div>-->

          <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
              <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
              <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            </div>
          </div>
        </form>
      </div>

      <!--关于我们-->
      <div class="tab-pane fade" id="tab-about">
        {include file="../application/admin/view/tongcheng/system_config/about_us_config.html" /}
      </div>

      <!--合作加盟-->
      <div class="tab-pane fade" id="tab-cooperation">
        {include file="../application/admin/view/tongcheng/system_config/cooperation_config.html" /}
      </div>

      <!--骑手入驻协议-->
      <!--<div class="tab-pane fade" id="tab-rider_enter">
        {include file="../application/admin/view/tongcheng/rider_config/rider_enter_config.html" /}
      </div>-->

    </div>
  </div>
</div>
